var asHandler = {
    approve: function () {
        hot.confirm("确定同意售后？", function () {
            hot.ajax(apiUri + "/approve", {
                id: $("#id").val()
            }, function (apiResult) {
                if (apiResult.resultCode === 2000) {
                    hot.tip.success("操作成功", function () {
                        window.location.reload();
                    });
                } else {
                    hot.tip.error(apiResult.resultMsg);
                }
            }, function () {
            }, "post", 300);
        });
    },
    refuse: function () {
        layer.prompt({title: '拒绝售后', formType: 2}, function (text, index) {
            hot.ajax(apiUri + "/refuse", {
                id: $("#id").val(),
                remark: text
            }, function (apiResult) {
                if (apiResult.resultCode === 2000) {
                    hot.tip.success("操作成功", function () {
                        window.location.reload();
                    });
                } else {
                    hot.tip.error(apiResult.resultMsg);
                }
            }, function () {
            }, "post", 300);
        });
    },
    refund: function () {
        layer.prompt({title: '请确定退款金额', formType: 1, value: $("#hdTotalAmount").val()}, function (text, index) {
            hot.ajax(apiUri + "/refund", {
                id: $("#id").val(),
                refundAmount: text
            }, function (apiResult) {
                if (apiResult.resultCode === 2000) {
                    hot.tip.success("操作成功", function () {
                        window.location.reload();
                    });
                } else {
                    hot.tip.error(apiResult.resultMsg);
                }
            }, function () {
            }, "post", 300);
        });
    }
}